﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ControlPhanQuyenCayPhanCap.ascx.cs" Inherits="WebUserControl_ControlPhanQuyenCayPhanCap" %>
<%@ Register assembly="DevExpress.Web.ASPxEditors.v9.2" namespace="DevExpress.Web.ASPxEditors" tagprefix="dxe" %>
<%@ Register assembly="DevExpress.Web.ASPxTreeList.v9.2.Export" namespace="DevExpress.Web.ASPxTreeList.Export" tagprefix="dxwtl" %>
<%@ Register assembly="DevExpress.Web.ASPxTreeList.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxTreeList" tagprefix="dxwtl" %>


<link rel="stylesheet" href='<%=ResolveUrl("~/LayoutCss/K_BaoCaoFormLayout.css")%>' type="text/css" />

<script type="text/javascript">
     function pageLoad() {
       $("#<%= btXem.ClientID %>").click(function() { 
        $.blockUI({
             message: '<h1>Xin vui lòng chờ xử lý</h1>', 
            css: { 
            border: 'none', 
            padding: '15px', 
            backgroundColor: '#f00', 
            opacity: .5, 
            color: '#fff'
        } }); 
        }); 
         $("#<%= btFindNode.ClientID %>").click(function() { 
        $.blockUI({
             message: '<h1>Xin vui lòng chờ xử lý</h1>', 
            css: { 
            border: 'none', 
            padding: '15px', 
            backgroundColor: '#f00', 
            opacity: .5, 
            color: '#fff'
        } }); 
        }); 
        $("#<%= btExpand.ClientID %>").click(function() { 
        $.blockUI({
             message: '<h1>Xin vui lòng chờ xử lý</h1>', 
            css: { 
            border: 'none', 
            padding: '15px', 
            backgroundColor: '#f00', 
            opacity: .5, 
            color: '#fff'
        } }); 
        }); 
         $("#<%= btColap.ClientID %>").click(function() { 
        $.blockUI({
             message: '<h1>Xin vui lòng chờ xử lý</h1>', 
            css: { 
            border: 'none', 
            padding: '15px', 
            backgroundColor: '#f00', 
            opacity: .5, 
            color: '#fff'
        } }); 
        }); 
        $("#<%= btSave.ClientID %>").click(function() { 
        $.blockUI({
             message: '<h1>Xin vui lòng chờ xử lý</h1>', 
            css: { 
            border: 'none', 
            padding: '15px', 
            backgroundColor: '#f00', 
            opacity: .5, 
            color: '#fff'
        } }); 
        }); 
        Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
                function EndRequestHandler(sender, args) {
                        $.unblockUI();
                }
        }  
   
</script> 
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
       <fieldset>
    <legend>Phân quyền User Xem cây phân cấp</legend>
    <div class="fm-req">
      <label for="DropUser">Chọn User:</label>
        <asp:DropDownList ID="DropUser" runat="server">
        </asp:DropDownList>
        <asp:Button ID="btXem" runat="server" Width="50px" onclick="btXem_Click" Text="Xem" />
      </div>
      <div class="fm-req">
      <label for="txtNode">Tìm nhánh:</label>
          <asp:TextBox ID="txtNode" Width="100px" runat="server"></asp:TextBox><asp:Button ID="btFindNode" Width="50px" runat="server" onclick="btFindNode_Click" Text="Tìm" />
      </div>
      </fieldset>
      <div>
          <asp:Button ID="btExpand" runat="server" onclick="btExpand_Click" Text="Mở ra" />
          &nbsp;&nbsp;
           <asp:Button ID="btColap" runat="server" onclick="btColap_Click" Text="Thu lại" />
           &nbsp;&nbsp;
          <asp:Button ID="btSave" runat="server" onclick="btSave_Click" Text="Lưu" />
          
      </div>
      <br />
       <dxwtl:ASPxTreeList ID="ASPxTreeList1" runat="server" 
             KeyFieldName="Salesp_Key"   onhtmlrowprepared="ASPxTreeList1_HtmlRowPrepared"
            ParentFieldName="Recommender" AutoGenerateColumns="false"> 
            <SettingsBehavior AllowDragDrop="false" AllowSort="false" AutoExpandAllNodes="false" /> 
             <Columns>
                <dxwtl:TreeListTextColumn Caption="Tư vấn viên" FieldName="Tư Vấn Viên" 
                    VisibleIndex="0">
                </dxwtl:TreeListTextColumn>
                
                <dxwtl:TreeListTextColumn Caption="TTPP" FieldName="sitename" 
                    VisibleIndex="1">
                </dxwtl:TreeListTextColumn>
                 <dxwtl:TreeListTextColumn Visible="false" Caption="Salesp_Key" FieldName="Salesp_Key" 
                    VisibleIndex="4">
                </dxwtl:TreeListTextColumn>
                <dxwtl:TreeListCheckColumn Caption="Phân quyền" FieldName="msel"   VisibleIndex="3">
                    <DataCellTemplate>
                        <asp:CheckBox ID="CheckBox1" runat="server" Checked='<%# Eval("msel") %>' />
                    </DataCellTemplate>
                </dxwtl:TreeListCheckColumn>
             </Columns>
    </dxwtl:ASPxTreeList>
   
    </ContentTemplate>
</asp:UpdatePanel>




